#include <stdlib.h>
#include <stdio.h>
int main()
{
   int max_save[10][7]={{1,1,1,1,1,1,0},
                        {0,1,1,0,0,0,0},
                        {1,1,0,1,1,0,1},
                        {1,1,1,1,0,0,1},
                        {0,1,1,0,0,1,1},
                        {1,0,1,1,0,1,1},
                        {1,0,1,1,1,1,1},
                        {1,1,1,0,0,0,0},
                        {1,1,1,1,1,1,1},
                        {1,1,1,1,0,1,1}};
   int num,col;
   scanf("%d",&num);
   /*模拟七段数码显示管分5行输出，
    *奇数行只输出空格或者-,
    *偶数行只输出空格或者|。*/
   //start
   char s[16];
   s[2]=(max_save[num][0]==1?'-':' ');
   s[4]=(max_save[num][5]==1?'|':' ');
   s[6]=(max_save[num][1]==1?'|':' ');
   s[8]=(max_save[num][6]==1?'-':' ');
   s[10]=(max_save[num][4]==1?'|':' ');
   s[12]=(max_save[num][2]==1?'|':' ');
   s[14]=(max_save[num][3]==1?'-':' ');
   for(col=1;col<=15;col=col+2)
   {s[col]=' ';}
   for(col=1;col<15;col++)
   {
   	 printf("%c",s[col]);
   	 if(col%3==0)
     printf("\n"); 
   }
   //end
   return 0;
}